package com.wuzuqing.android.eightdiagrams

import com.wuzuqing.android.eightdiagrams.base.BaseAdapter
import com.wuzuqing.android.eightdiagrams.base.BaseViewHolder
import com.wuzuqing.android.eightdiagrams.model.Fc3DOpenModel
import com.wuzuqing.android.eightdiagrams.model.LhcBean
import com.wuzuqing.android.eightdiagrams.utils.DataUtils

/**
 * @CopyRight: 广州仰望星空云科技有限公司
 * @Author : wuzuqing
 * @Email:wuzuqing@xinyu668.com
 * @CreateTime: 26.7.24 10:12 AM
 * @Description: 请写描述
 */
class LhcOpenAdapter : BaseAdapter<LhcBean>(R.layout.item_lhc_open) {
    var isShowOrigin: Boolean = false
    private var ju: String = "无"

    fun setJu(ju: String) {
        this.ju = ju
    }

    fun changeShowState(flag: Boolean) {
        if (isShowOrigin == flag) {
            return
        }
        isShowOrigin = flag
        notifyDataSetChanged()
    }

    override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
        getItem(position)?.also {
            holder.setText(R.id.tv_date, it.date)
//            if (it.model == null) {
//                it.model = DataUtils.getFc3DOpenDate(it.date)
//            }
//            if (it.gan == null) {
//                DataUtils.getFc3DOpenGan(it, ju)
//            }
//            val item = it.model!!
            holder.setText(R.id.tv_open, it.list.toString())
//            holder.setText(R.id.tv_gan, it.gan.orEmpty())
//            holder.setText(R.id.tv_men, it.men.orEmpty())
//            holder.setText(R.id.tv_xing, it.xing.orEmpty())
//            holder.setText(R.id.tv_shen, it.shen.orEmpty())
        }
    }
}